// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueLazyLoad from 'vue-lazyload'
import infiniteScroll from 'vue-infinite-scroll'
import {currency} from './util/currency.js'
import Vuex from 'vuex'
 
import './assets/css/base.css'
import './assets/css/checkout.css'
import './assets/css/login.css'
import './assets/css/product.css'

Vue.config.productionTip = false

Vue.use(infiniteScroll);
Vue.use(Vuex);
Vue.use(VueLazyLoad,{
  loading:"./../static/loading-svg/loading-bars.svg"
});

Vue.filter("currency",currency);

const store = new Vuex.Store({
	state:{
		NickName:'',
		cartCount:0
	},
	mutations:{
		updateUserInfo(state,NickName){
			state.NickName = NickName;
		},
		updatecartCount(state,cartCount){
			state.cartCount += cartCount;
		},
		initCartCount(state,cartCount){
			state.cartCount = cartCount;
		}
	}
})//Vuex

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
